/*
 * Copyright (C) 2011, EADS France
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */
package xowl.interpreter.impl;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Laurent WOUTERS
 */
public class BaseIRIProvider implements xowl.interpreter.IRIProvider {
    protected Map<String, xowl.lang.owl2.IRI> mapIRIs;
    
    public BaseIRIProvider() {
        mapIRIs = new HashMap<String, xowl.lang.owl2.IRI>();
    }
    
    @Override public xowl.lang.owl2.IRI getIRI(String fullIRI) {
        if (mapIRIs.containsKey(fullIRI))
            return mapIRIs.get(fullIRI);
        xowl.lang.owl2.IRI objIRI = new xowl.lang.owl2.IRI();
        objIRI.setHasValue(fullIRI);
        mapIRIs.put(fullIRI, objIRI);
        return objIRI;
    }
}
